﻿using System;
using System.Collections.Generic;
using KM.DAT;
using KM.ENT;
using KM.Models;

namespace KM.BUS
{
    public class busSanPham
    {
        public busSanPham()
        {
            //
            // TODO: Add constructor logic here
            //
        }
        public void deleteSlide(int id)
        {
            datSanPham datSP = new datSanPham();
            datSP.deleteSlide(id);
        }
        public List<entSanPham> getSlide()
        {
            datSanPham datSP = new datSanPham();
            List<entSanPham> lst = new List<entSanPham>();
            lst = datSP.getSlide();
            return lst;
        }
        public void createEdit(entSanPham entSP)
        {
            datSanPham datSP = new datSanPham();
            datSP.createEdit(entSP);
        }
        public List<entSanPham> getAll(int Id, ref PagingInfoModel page)
        {
            datSanPham datSP = new datSanPham();
            List<entSanPham> lst = new List<entSanPham>();
            lst = datSP.getAll(Id, ref page);
            return lst;
        }
        public List<entSanPham> getSpCungLoai(int Id)
        {
            datSanPham datSP = new datSanPham();
            List<entSanPham> lst = new List<entSanPham>();
            lst = datSP.getSpCungLoai(Id);
            return lst;
        }
        public List<entSanPham> getListByType(int type, int top)
        {
            datSanPham datSP = new datSanPham();
            List<entSanPham> lst = new List<entSanPham>();
            lst = datSP.getListByType(type, top);
            return lst;
        }
        public entSanPham getInfo(int Id)
        {
            datSanPham datSP = new datSanPham();
            entSanPham entSPNew = new entSanPham();
            entSPNew = datSP.getInfo(Id);
            return entSPNew;
        }
        public bool delete(int Id)
        {
            datSanPham datSP = new datSanPham();
            datSP.delete(Id);
            return true;
        }
    }
}